package com.example.sixtrainingdemo.view;

import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;

import com.example.sixtrainingdemo.R;
import com.example.sixtrainingdemo.base.BaseFragment;
import com.example.sixtrainingdemo.contract.MainContract;
import com.example.sixtrainingdemo.entity.Goods;

import java.util.List;

public class VideoFragment extends BaseFragment implements MainContract.IMainView, View.OnClickListener {

//   private RecyclerView mGoodsRecyclerView;
//   private EditText mSearchEdit;
//   private GoodsListAdapter mRecyclerAdapter;
//   private MainContract.IMainPresenter mMainPresenter;
//   private List<Goods> mGoodsList;

   private RelativeLayout mVideoLayout;


   @Override
   protected int getLayoutId() {
      return R.layout.fragment_video;
   }

   @Override
   protected void initView() {
      mVideoLayout = mView.findViewById(R.id.videoView_01);
//      mMainPresenter = new MainPresenter(this, getContext());
//      mGoodsList = new ArrayList<>();
//      mSearchEdit = mView.findViewById(R.id.search_edit);
//      mGoodsRecyclerView = mView.findViewById(R.id.rv_goods);
//      StaggeredGridLayoutManager staggeredGridLayoutManager =
//              new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
//      mGoodsRecyclerView.setLayoutManager(staggeredGridLayoutManager);
//      mRecyclerAdapter = new GoodsListAdapter(mGoodsList);
//      mGoodsRecyclerView.setAdapter(mRecyclerAdapter);
//      mMainPresenter.getGoodsList();
   }
   @Override
   protected void initListener() {
      mVideoLayout.setOnClickListener(this);
   }
//
   @Override
   public void showGoodsList(List<Goods> goodsList) {
//      mGoodsList = goodsList;
//      Log.d("", "showGoodsList " + mGoodsList.size());
//      mRecyclerAdapter.updateData(mGoodsList);
   }

   @Override
   public void onClick(View v) {
      int id = v.getId();
      if (id == R.id.videoView_01) {
         Intent intent = new Intent(mContext, ProductDetailsActivity.class);
         startActivity(intent);
      }
   }



}